package com.jianneng.jdg.model.adapter;

import java.util.List;

import com.example.com.jianneng.jdg.R;
import com.jianneng.jdg.model.user.WagesInfo;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class Worker_MyTeam_Adapter extends BaseAdapter {
	
	private LayoutInflater inflater=null;
	private List<WagesInfo> workerinfo=null;
	

	public Worker_MyTeam_Adapter(Context context,List<WagesInfo> workerinfo){
		this.inflater=LayoutInflater.from(context);
		this.workerinfo=workerinfo;
		
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return workerinfo.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return workerinfo.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View view=null;
		ViewHolder viewHolder=null;
		if (convertView==null) {
			view = inflater.inflate(R.layout.myteam_listview, null);
			viewHolder=new ViewHolder();
			viewHolder.project_team=(TextView) view.findViewById(R.id.project_team);
			viewHolder.iv_more1=(ImageView) view.findViewById(R.id.iv_more1);
			viewHolder.exit_team=(TextView) view.findViewById(R.id.exit_team);
			view.setTag(viewHolder);
			
		}else{
			view=convertView;
			viewHolder=(ViewHolder) view.getTag();
		}
		
		return view;
	}
	private static class ViewHolder{
		TextView project_team;
		ImageView iv_more1;
		TextView exit_team; 
		
	}
}
